import axios from 'axios';
import type { AxiosInstance } from 'axios';
import * as rax from 'retry-axios';

const baseURL = import.meta.env.VITE_BASE_URL;

const service: AxiosInstance = axios.create({
  baseURL: baseURL,
  timeout: 300000,
});

service.defaults.raxConfig = {
  instance: service,
};
rax.attach(service);

export default service;
